<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>

	<link rel="icon" href="/images/default/fav_icon.jpg" type="image/gif"/>
	
	<?php   
	   echo $this->headTitle(),"\n";	   
	   echo $this->headLink(),"\n";	    
	   echo $this->headMeta(),"\n";    
	    	
       echo $this->jQuery(),"\n";
    	
	   echo $this->headStyle(),"\n";	    
	   echo $this->headScript(),"\n";
	?>
	<script type="text/javascript">
	
	$(document).ready(function() {
		
					
					$("#lang span").click(function(){
						flag=$(this).attr("id");
						if(flag=="flag_vi")
						{
							flag="vi";
						}
						else if(flag=="flag_en")						
						{
							flag="en";
						}
						else if(flag=="flag_ja")
						{
							flag="ja";
						}
						else if(flag=="flag_zh")
						{
							flag="zh";
						}
						else if(flag=="flag_fr")
						{
							flag="fr";
						};
						$.ajax({
							url:"/index/changelang",
							type:"POST",
							cache:false,
							data:"lang="+flag,
							success:function(data)
							{
								if(data=='1')
								{
									location.reload(true);
								}
							},
							error:function(data)
							{
								alert(data);
							}
							});
						});


					$(".login").click(function(){
						$(".form_login").show();
						$(".login em").addClass("overlap");
					});
					
					$(".form_login").mouseup(function() { 
					        return false;
					    });
					$(this).mouseup(function(login) {
				        if(!($(login.target).parent('.form_login').length > 0)) {
					        $("#username").val("");
					        $("#password").val("");
				        	$(".form_login").hide();
				        	$(".login em").removeClass("overlap");
				        }
				    });
				    
					$("#login_social").click(function(){
						$(".form_login").hide();
			        	$(".login em").removeClass("overlap");
			        	data='<table><tr><td><img src="/images/hybrid/facebook.png" alt="facebook"/></td><td><img src="/images/hybrid/twitter.png" alt="twitter"/></td><td><img src="/images/hybrid/yahoo.png" alt="yahoo"/></td><td><img src="/images/hybrid/google.png" alt="google"/></td>'+
						'</tr></table>';
						$.colorbox({html:data,transition:'elastic',width:302,height:139,'onClose':function(){
							alert("OK");
							}});
						var img = $("#cboxLoadedContent table tbody tr td img");
						img.css("cursor","pointer");
						img.click(function(){
							window.open("/index/login/provider/"+$(this).attr("alt"),"","width=800, height=400");
							});
						});
					$("#loginButton").click(function(){
						user = $("#username").val();
						pass=$("#password").val();
						$.ajax({
							url:"/index/checklogin",
							type:"POST",
							cache:true,
							data:"user="+user+"&pass="+pass,
							success:function(data)
							{
								alert(data);
							},
							error:function(data)
							{
								alert(data);
							}
							});
					 });
					
	});
	function confirmAll()
	{
		$.colorbox.close();
	}
	
	</script>


</head>
<body>

<?php //echo $this->render('mainheader.phtml');?>
 
<header id="main_header">
    <div class="header_content">
     
        <div class="left">
        	<a href="/"><img src="/images/default/logo.png" alt="Hoi An Express" width="200" height="140"/></a>	
        </div>
        
        <div class="right">
        	
        	<div id="lang">		
	<!--         	<input type="text" name="search" /> -->
				<span id="flag_vi"></span>
				<span id="flag_en"></span>
				<span id="flag_ja"></span>
				<span id="flag_zh"></span>
				<span id="flag_fr"></span>			
			</div>
			
			<div class="slogan">A smile, a look, expressions of Indochina... <span>Pure luxury</span></div>
			
        </div>
		            	
     	<nav id="main_header_navigation"> 
     		<ul class="navigation">
     			<li>
     				<a href="/"><?php echo $this->translate('MAIN.TOP.MENU.HOME');?> </a>
     			</li>
     			
               <?php 
               //echo $this->navigation(Zend_Registry::get("navigation"))->menu()->setMinDepth(0)->setMaxDepth(1)->setRenderParents(true)->setOnlyActiveBranch(false)->renderMenu();
               $main_menu = $this->navigation(Zend_Registry::get("navigation"))->findOneById('top');
               echo $this->navigation()->menu()->setMinDepth(0)->setMaxDepth(0)->setRenderParents(true)->setOnlyActiveBranch(false)->renderMenu($main_menu);
               ?>          
     		</ul>
        </nav>     	
      
    </div>
</header>

 
<div id="main_content">
	
	<aside id="left">	
	
		<nav id="main_left_navigation">                                   
           <?php 
               $side_menu = $this->navigation(Zend_Registry::get("navigation"))->findOneById('left');
               echo $this->navigation(Zend_Registry::get("navigation"))->menu()->setMinDepth(0)->setMaxDepth(0)->setRenderParents(true)->setOnlyActiveBranch(false)->renderMenu($side_menu);
           ?>          
        </nav>	
		<span>SEARCH</span>
		<div id="main_left_search">
			<ul> 
			    <li><a id="main_left_search_tour">TOURS</a></li> 
			    <li><a id="main_left_search_hotel">HOTELS</a></li> 
 			 </ul> 
			  <div id="tab_main_left_search_tour">
			  	<?php echo $this->searchForm()->setSearchCountry()->setSearchCity()->toString(); ?>
			  </div> 
			  <div id="tab_main_left_search_hotel">
			  	<?php echo $this->searchForm()->setSearchCountry()->setSearchCity()->setSearchStar()->toString(); ?>
			  </div> 
		</div>
	</aside>
	
	
	
	<div id="right">
	
		<?php if(Zend_Controller_Front::getInstance()->getRequest()->getControllerName() == 'tour'){?>
		<div id="main_countries_navigation">		
			<?php 
				$countries_menu = $this->navigation(Zend_Registry::get("navigation"))->findOneByLabel('MAIN.TOP.MENU.DESTINATIONS');
				echo $this->navigation(Zend_Registry::get("navigation"))->menu()->setMinDepth(0)->setMaxDepth(1)->renderMenu($countries_menu);
			?>     
		</div>	
		<?php }?>
	   		
		<div id="main_right_content" >
			
	   	    <?php if(Zend_Controller_Front::getInstance()->getRequest()->getControllerName() != 'index'){?>
			<div id="breadcrumbs">  
	         	<?php echo $this->navigation(Zend_Registry::get("navigation"))->breadcrumbs()->setMinDepth(0)->setLinkLast(true)->setSeparator(' > ');?>&nbsp;
	   	    </div>  
	   		<?php }?>
	   		
	   	    <section id="content"><?php echo $this->layout()->content;?></section>
	   	    
	   	    <section>
			<?php
				//Just for dev (check the site map)
				//echo $this->navigation(Zend_Registry::get("navigation"))->menu()->setMinDepth(0)->setMaxDepth(10)->setRenderParents(true);
			?>
			</section>
	    </div>
		
	</div>
		
</div>
		
<?php //echo $this->render('mainfooter.phtml');?>
<footer id="main_footer">
    
		<nav id="main_bottom_navigation">
<!-- 			<ul> -->
<!-- 				<li><a href="#">Partners</a></li> -->
<!-- 				<li><a href="#">Terms & Conditions</a></li> -->
<!-- 				<li><a href="#">Private Policy</a></li> -->
<!-- 				<li><a href="#">Site Map</a></li> -->
<!-- 				<li><a href="#" class="noborder">Contact Us</a></li> -->
<!-- 			</ul> -->
			 <?php 
               $bottom_menu = $this->navigation(Zend_Registry::get("navigation"))->findOneById('bottom');
               echo $this->navigation(Zend_Registry::get("navigation"))->menu()->setMinDepth(0)->setMaxDepth(1)->setRenderParents(true)->setOnlyActiveBranch(false)->renderMenu($bottom_menu);
               ?> 
		</nav>
		
		<label>2012 HoiAn Corporation. All right reserved	</label>
    	    
</footer>

</body>
</html>